package builder;

public class Director {
//链式调用，使代码更加简洁和易读
    public Product buildA() {
        Builder planA = new WorkerPlanA()
                .buildA()
                .buildB()
                .buildC()
                .buildD();
        return planA.getProduct();
    }

    public Product buildB() {
        Builder planB = new WorkerPlanB()
                .buildB()
                .buildC()
                .buildD()
                .buildA();
        return planB.getProduct();
    }
}
